const { defineConfig } = require('@vue/cli-service')

const name = process.env.VUE_APP_TITLE || '梁园的个人作品展示网站' // 网页标题

module.exports = defineConfig({
  configureWebpack: {
    name: name
  },
  transpileDependencies: true,
  devServer: {
    port: 8081,
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: `http://localhost:8080`,
        changeOrigin: true,
        pathRewrite: {
          ['^' + process.env.VUE_APP_BASE_API]: ''
        }
      },
      // 图片资源代理
      '/profile': {
        target: `http://localhost:8080`,
        changeOrigin: true,
        pathRewrite: {
          ['^/profile']: '/profile'
        }
      }
    }
  }
})
